package com.ccrfid.rmc6.repository.personnel;

import com.ccrfid.rmc6.entity.personnel.PersonnelPrisonerEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;

import java.sql.Timestamp;

public interface PersonnelPrisonerRepository extends Repository<PersonnelPrisonerEntity, Long> {
    //
    void deleteByPersonnelId(Long personnelId);
    //
    PersonnelPrisonerEntity getByPersonnelId(Long personnelId);
    PersonnelPrisonerEntity getByUnifoNoAndOutTimeIsNotNull(String unifoNo);

    PersonnelPrisonerEntity save(PersonnelPrisonerEntity entity);

    @Query("select max(p.updateTime) from PersonnelPrisonerEntity p")
    Timestamp getMaxUpdatetime();
}
